home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Floppyshop 2
/
Floppyshop - 2.zip
/
Floppyshop - 2.iso
/
art&graf.ix
/
art-0034
/
fracsurf
/
fracsurf.doc
next >
Wrap
Text File
|
1997-04-16
|
4KB
|
144 lines
THE FRACTAL LANDSCAPE GENERATOR
This program generates random fractal
surfaces on a 128x128 facet grid and
allows you to view them from any point in
space. It runs in low resolution
(320x200) or high resolution (640x400) on
any Atari ST.
Operation of the program is self-
explanatory: Run 'FRACSURF.PRG' in the
usual way from the Desktop and it will
immediately generate and display
landscape '0' ('0' is the seed for the
random number generator). Pressing SPACE
will then toggle between the view of the
landscape and the menu:
f1 - New landscape
This allows you to generate a new
landscape. The program asks you for
an 'f' value and a seed.
'f' defines the degree of ruggedness
of the landscape - most realistic
values lie between about 0.4 and
1.5. Greater values than 1.5
generate surfaces more like
moonscapes. The seed is a means of
identifying the landscape. Each
value will produce a totally unique
surface - one of my favourites is
landscape '12345' with an 'f' value
of 0.8.
While generating a new surface
(which takes about a minute) the
program will illustrate its progress
by filling a square on screen, each
pixel representing a facet which has
been calculated.
The time taken to shade and plot the
surface depends on the detail
setting (defined by f6). The default
startup value of 4 means that the
surface is plotted as a grid of
32x32 facets.
f2 - Set view point
This allows you to define your view
position in the 3D universe and your
viewing direction. Enter first your
x,y,z coordinates and then the x,y,z
coordinates of the point on which
you wish the screen to be centred
(usually 0,0,0). The surface lies
within the limits -320 and 320 in
the x and y directions.
In addition you will be asked for a
magnification factor for the view.
Values >1 give a telephoto view,
whilst values <1 give a wide-angle
view.
f3 - Set light position
As for the view position the x,y,z
coordinates of the single light
source are entered. The light is
actually calculated as being
infinitely far away in the direction
of this point (ie. the rays are
parallel).
f4 - Define sea level
(& snow line in lo-res)
The sea level (and snow line) can be
set to any height, default values
being 0 and 50, respectively.
f5 - Save screen (Degas)
This saves the current view as a
standard, uncompressed Degas file.
f6 - Set detail
The detail factor for the display of
surfaces can be in the range 0 to 6
which give the following surface
resolutions:
0 - 2x2 facets
1 - 4x4
2 - 8x8
3 - 16x16
4 - 32x32
5 - 64x64
6 - 128x128
Plotting and shading times go up by
a factor of 4 with each increase in
detail.
f7 - Landscape information
This gives information on the
current landscape and view. In
addition it calculates the 'fractal
dimension' (D) of the surface, which
for all fractal surfaces lies
between 2 and 3 (see Benoit
Mandelbrot's book 'The Fractal
Geometry of Nature'). Higher values
indicate a more rugged landscape,
most earthbound landscapes lying
between 2.3 and 2.4. There is
probably a mathematical relationship
between 'f' and 'D', although I've
no idea what it is!
f10 - Quit
Thats it - I hope you have fun exploring
the infinity of landscapes that can be
generated.
For anyone who's interested, FRACSURF.PRG
is written in GFA Basic 2 and Fast Basic
assembler, and the complete source code
is available from the address below for
the modest fee of £5.00. Any
comments/complaints are also welcome!
Jonathan Millar
St Catherine's College
Oxford
OX1 3UJ